//固定资产




import request from "@/utils/request";

// 引入qs模块，用来序列化post类型的数据，后面会提到
import QS from "qs";

// 园区-获取列表 分页
export function getParkList (params) {
  return request({
    url: `/assets/park/findPage`,
    method: "get",
    params,
  });
}

// 园区-获取列表 不分页
export function getParkListAll (params) {
  return request({
    url: `/assets/park/list`,
    method: "get",
    params,
  });
}

// 园区-详情
export function getParkDetails (params, parkId) {
  return request({
    url: `/assets/park/info/${parkId}`,
    method: "get",
    // params
  });
}

// 园区-新增
export function createPark (data) {
  return request({
    url: `/assets/park/save`,
    method: "post",
    data,
  });
}

// 园区-修改
export function updatePark (data) {
  return request({
    url: `/assets/park/update`,
    method: "post",
    data,
  });
}

// 园区-删除
export function daletePark (data, parkId) {
  return request({
    url: `/assets/park/delete/${parkId}`,
    method: "post",
    data,
  });
}

// 楼栋、单元、楼层-获取列表
export function getHouseTree (params) {
  return request({
    url: `/assets/storey/treeList`,
    method: "get",
    params,
  });
}

// 楼栋、单元、楼层 - 新增
export function createHouseTree (data) {
  return request({
    url: `/assets/storey/save`,
    method: "post",
    data,
  });
}

// 园楼栋、单元、楼层 - 修改
export function updateHouseTree (data) {
  return request({
    url: `/assets/storey/update`,
    method: "post",
    data,
  });
}

// 园楼栋、单元、楼层 -删除
export function daleteHouseTree (data, id) {
  return request({
    url: `/assets/storey/delete/${id}`,
    method: "post",
    data,
  });
}

// /assets/storey/list?id=21
// 园区、楼栋、单元、楼层-获取单个列表 查询园区传 0
export function getOneTree (params) {
  return request({
    url: `/assets/storey/list`,
    method: "get",
    params,
  });
}

// 房屋-获取列表 分页
export function getHouseList (params) {
  return request({
    url: `/assets/house/findPage`,
    method: "get",
    params,
  });
}

// 房屋-获取列表 不分页
export function getHouseListAll (params) {
  return request({
    url: `/assets/house/list`,
    method: "get",
    params,
  });
}

// 房屋 - 新增
export function createHouse (data) {
  return request({
    url: `/assets/house/save`,
    method: "post",
    data,
  });
}

// 房屋 -删除
export function daleteHouse (data, id) {
  return request({
    url: `/assets/house/delete/${id}`,
    method: "post",
    data,
  });
}

// 房屋 - 修改
export function updateHouse (data) {
  return request({
    url: `/assets/house/update`,
    method: "post",
    data,
  });
}

// 查找房间下面的客户
export function findHouseCustomers (params) {
  return request({
    url: `/assets/customer/findHouseCustomers`,
    method: "get",
    params,
  });
}


// 查找房间下面的客户 收费中心-应收账单中使用
export function getCustomerByHouseId (params) {
  return request({
    url: `/assets/contract/getCustomerByHouseId`,
    method: "get",
    params,
  });
}


// 绑定客户

export function bindCustomer (data) {
  return request({
    url: `/assets/house/bindCustomer`,
    method: "post",
    data,
  });
}

// 解绑客户
export function unbindCustomer (data) {
  return request({
    url: `/assets/house/unbindCustomer  `,
    method: "post",
    data,
  });
}

// 客户-获取列表 分页
export function getCustomerList (params) {
  return request({
    url: `/assets/customer/findPage`,
    method: "get",
    params,
  });
}

// 客户-获取列表 不分页
export function getCustomerListAll (params) {
  return request({
    url: `/assets/customer/list`,
    method: "get",
    params,
  });
}

// 客户 - 新增
export function createCustomer (data) {
  return request({
    url: `/assets/customer/save`,
    method: "post",
    data,
  });
}

// 客户 -删除
export function daleteCustomer (data, id) {
  return request({
    url: `/assets/customer/delete/${id}`,
    method: "post",
    data,
  });
}

// 客户 - 修改
export function updateCustomer (data) {
  return request({
    url: `/assets/customer/update`,
    method: "post",
    data,
  });
}

// 银行-获取列表 分页
export function getAccountList (params) {
  return request({
    url: `/assets/account/findPage`,
    method: "get",
    params,
  });
}

// 银行 - 新增
export function createAccount (data) {
  return request({
    url: `/assets/account/save`,
    method: "post",
    data,
  });
}

// 银行 -删除
export function daleteAccount (data, id) {
  return request({
    url: `/assets/account/delete/${id}`,
    method: "post",
    data,
  });
}

// 银行 - 修改
export function updateAccount (data) {
  return request({
    url: `/assets/account/update`,
    method: "post",
    data,
  });
}

// 合同-获取列表 分页
export function getContractList (params) {
  return request({
    url: `/assets/contract/findPage`,
    method: "get",
    params,
  });
}

// 合同 - 新增
export function createContract (data) {
  return request({
    url: `/assets/contract/save`,
    method: "post",
    data,
  });
}

// 合同 -终止
export function daleteContract (data, id) {
  return request({
    url: `/assets/contract/terminate/${id}`,
    method: "post",
    data,
  });
}

// 合同 -开启
export function startContract (data, id) {
  return request({
    url: `/assets/contract/startContract/${id}`,
    method: "post",
    data,
  });
}

// 合同 - 修改
export function updateContract (data) {
  return request({
    url: `/assets/contract/update`,
    method: "post",
    data,
  });
}

// 合同 - 续期
export function renewalContract (data) {
  return request({
    url: `/assets/contract/renewal`,
    method: "post",
    data,
  });
}


//导入历史记录
export function uploadRecords (data) {
  return request({
    url: `/assets/imports/findPage`,
    method: "post",
    data,
  });
}


// 根据园区查询下面的 单元楼层房屋
export function getTreeHouseList (params) {
  return request({
    url: `/assets/storey/treeHouseList`,
    method: "get",
    params,
  });
}